package tr.com.netgis.log;

import java.util.List;

import tr.com.netgis.pojo.NGLocation;
import tr.com.netgis.util.Constants;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.TextView;

/**
 * 
 * @author NetGis
 * 
 */
public class LogArrayAdapter<T> extends ArrayAdapter<NGLocation> {

	private List<NGLocation> listItems;

	public List<NGLocation> getListItems() {
		return listItems;
	}

	public void setListItems(List<NGLocation> listItems) {
		this.listItems = listItems;
	}

	public LogArrayAdapter(Context context, int textViewResourceId) {
		super(context, textViewResourceId);
	}

	public LogArrayAdapter(Context context, int textViewResourceId,
			List<NGLocation> objects) {
		super(context, textViewResourceId, objects);
		this.listItems = objects;

	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = super.getView(position, convertView, parent);
		((TextView)v).setTextSize(12);
		v.setLayoutParams(new LayoutParams(v.getLayoutParams().width, Constants.LOG_LIST_ITEM_HEIGHT));
		return v;
	}

}
